import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import './style.css';
import reportWebVitals from './reportWebVitals';
import RouteList from './Routes'
import { SafeArea } from 'antd-mobile'

if (process.env.NODE_ENV === 'production') {
  document.addEventListener('deviceready', function() {
    init()
  })
} else {
  init()
}

function init() {
  const root = ReactDOM.createRoot(document.getElementById('root'));
  root.render(
    <React.StrictMode>
      <div style={{ background: '#ace0ff' }}>
        <SafeArea position='top' />
      </div>
      <RouteList />
    </React.StrictMode>
  );
}

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
